<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小提示</title>
    <style>
        .green2 {
            position: relative;
            width: 200px;
            height: 100px;
            background: lightgreen;
            margin: 30px;
            padding: 10px;
        }

        .green2::before {
            content: "小提示";
            position: absolute;
            top: -15px;
            left: 0;
            font-size: 12px;
            color: #666;
        }
    </style>
</head>

<body>
    <div class="green2">123</div>
</body>

</html>